package net.lainiao.zhihu.reptitle;

import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.xml.sax.SAXException;

import java.io.IOException;

/**
 * Created by Administrator on 2016/1/14.
 */
public class ZhihuCollect {
    public static int getMax(String url) throws IOException, SAXException, InterruptedException {
        Document document=HtmlCommon.getDocument(url);
        Elements elements=document.select(".zm-invite-pager>span>a");
        if(elements.size()>0){
            int len=elements.size();
            len=len-2;
            Element element=elements.get(len);
            return Integer.parseInt(element.html());
        }
        return 0;
    }
}
